package com.mtsmda.designPattern.prototype;

import java.util.ArrayList;
import java.util.List;

public class Employees implements Cloneable {

	private List<String> employees;

	public Employees() {
		employees = new ArrayList<String>();
	}

	public Employees(List<String> employees) {
		this.employees = employees;
	}

	public List<String> getEmployees() {
		return employees;
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		List<String> newEmployees = new ArrayList<String>();
		for (String currentEmployee : employees) {
			newEmployees.add(currentEmployee);
		}
		return new Employees(newEmployees);
	}

	public void loadDates() {
		this.employees.add("Ivan");
		this.employees.add("Ivar");
		this.employees.add("Petr");
		this.employees.add("Lev");
		this.employees.add("Nikolay");
	}

}